<script>
    import modal from '@/mixins/modal'
    export default {
        name: 'RoleFormModal',
        mixins:[modal],
        computed: {
          formItem() {
            return this.row
          }
        }
    }
</script>
<template>
    <span>
        <IButton click @click="show = true" :type="type" :icon="icon" :perm="perm" :size="size">
          <slot></slot>
        </IButton>
        <Modal
            v-model="show"
            :title="title">
            <Form :model="formItem" :label-width="80">
              <Form-item label="角色名称" prop="name">
                  <Input v-model="formItem.name" placeholder="请输入角色名称"></Input>
              </Form-item>
              <Form-item label="角色标识" prop="Role">
                  <Input v-model="formItem.role" placeholder="请输入角色标识"></Input>
              </Form-item>
              <Form-item label="角色描述" prop="description">
                  <Input v-model="formItem.description" type="textarea" placeholder="请输入角色描述"></Input>
              </Form-item>
            </Form>
            <div slot="footer">
                <Button type="text" @click="show = false">取消</Button>
                <Button type="primary" :loading="loading" @click="ok">{{loading ? '拼命中...' :'确定'}}</Button>
            </div>
        </Modal>
    </span>
</template>
